import java.util.Arrays;
import java.util.Comparator;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-05-15
 * Time: 22:16
 */

public class test_3 {

    public static String largestNumber(int[] nums) {
        int n=nums.length;
        String[] strings=new String[n];
        for (int i = 0; i < n; i++) {
            strings[i] =""+nums[i];
        }
        Arrays.sort(strings, (a, b) ->
        {
            return (b + a).compareTo(a + b);
        });
        // 提取结果
        StringBuffer ret = new StringBuffer();
        for(String s : strings) ret.append(s);
        if(ret.charAt(0) == '0') return "0";
        return ret.toString();

    }
    public static void main(String[] args) {
        int[] ints=new int[]{1,5,6,4,8,9,7};
        largestNumber(ints);
        System.out.println();
        System.out.println("ddd".compareTo("aaa"));
    }
}
